import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { UserEntity } from "./entitys/user.entity"
import {AccountEntity} from "@/db/entitys/account.entity";
import { VideoEntity } from './entitys/video.entity';
import { PubTemplateEntity } from './entitys/pub-template.entity';
import { PubTaskEntity } from './entitys/pub-task.entity';
import { BiliVideoEntity } from './entitys/bili-video.entity';
import { VideoCutTemplateEntity } from './entitys/video-cut-template.entity';
import { PubRecordEntity } from './entitys/pub-record.entity';
import { CutRecordEntity } from './entitys/cut-record.entity';

@Injectable()
export class DbService {
  constructor(
    @InjectRepository(UserEntity)
    readonly userRepository: Repository<UserEntity>,

    @InjectRepository(AccountEntity)
    readonly accountRepository: Repository<AccountEntity>,

    @InjectRepository(VideoEntity)
    readonly videoRepository: Repository<VideoEntity>,

    @InjectRepository(PubTemplateEntity)
    readonly pubTemplateRepository: Repository<PubTemplateEntity>,

    @InjectRepository(PubTaskEntity)
    readonly pubTaskRepository: Repository<PubTaskEntity>,

    @InjectRepository(BiliVideoEntity)
    readonly biliVideoRepository: Repository<BiliVideoEntity>,

    @InjectRepository(VideoCutTemplateEntity)
    readonly videoCutTemplateRepository: Repository<VideoCutTemplateEntity>,

    @InjectRepository(PubRecordEntity)
    readonly pubRecordRepository: Repository<PubRecordEntity>,

    @InjectRepository(CutRecordEntity)
    readonly cutRecordRepository: Repository<CutRecordEntity>,
  ) {
  }
}


export const DbEntityList = [
  UserEntity, AccountEntity, VideoEntity, PubTemplateEntity, PubTaskEntity, BiliVideoEntity,
  VideoCutTemplateEntity, PubRecordEntity, CutRecordEntity, 
]